<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>填写相关资料</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="stylesheet" href="/static/wx/lib/sui/sm.min.css">
    <link rel="stylesheet" href="/static/wx/lib/sui/sm-extend.min.css">
    <link rel="stylesheet" href="/static/wx/css/reset.css">
    <link rel="stylesheet" href="/static/wx/css/main.css">
    <link rel="stylesheet" href="/static/wx/css/public_main.css">
</head>

<body>
    <div class="page-group">
        <div class="page page-current" id="">
            <!-- 主内容 -->
            <div class="content">
                <div class="setp-card">
                    <div class="step-box">
                        <div class="step-item selected">
                            <div class="step-item-line"><span></span></div>
                            <div class="step-item-text size-65 text-c">参与竞价</div>
                        </div>
                        <div class="step-item selected">
                            <div class="step-item-line"><span></span></div>
                            <div class="step-item-text size-65 text-c">看货信息</div>
                        </div>
                        <div class="step-item selected">
                            <div class="step-item-line"><span></span></div>
                            <div class="step-item-text size-65 text-c">提货信息</div>
                        </div>
                        <div class="step-item selected">
                            <div class="step-item-line"><span></span></div>
                            <div class="step-item-text size-65 text-c">收款信息</div>
                        </div>
                        <div class="step-item selected">
                            <div class="step-item-line"><span></span></div>
                            <div class="step-item-text size-65 text-c">递交委托书</div>
                        </div>
                    </div>
                    <div class="size-65 text-c">
                        以下提货信息，将作为拍卖后提货的法律依据
                    </div>
                </div>
                <div class="bs-box" style="background: rgb(255, 255, 255);">
                    <div class="bs-box-content">
                        <div class="bs-box-inner">
                            <div class="author-book">
                                <h3 class="text-c">委托书</h3>
                                <p class="book-content">
                                        今自愿全权委托上海沪东拍卖有限公司（以下简称沪东拍卖），对报案号<u>{$data.report_num | default='______________'}</u>的保险损余物品标的物进行竞价拍卖，拍卖标的物为我方所有或有依法可处置权。相关资料（物品清单、相关描述、质量和瑕疵、看货要求、提货条件及费用等）均已如实在平台上核对和提供，真实有效。
                                </p>
                                <p class="book-content">
                                        本单位（或人）设<u>{$info.back_price|default='______________'}</u>元为优先回购保留价。并参与（不参与）此标的物的竞价拍卖。同时已申请免交保证金，保证金由沪东拍卖担保。如违反拍卖相关规定，此拍卖标的物将由沪东拍卖任意处置。{if(isset($info))}{if($info.is_promise == 1)}同时已申请免交保证金，保证金由沪东拍卖担保。如违反拍卖相关规定，此拍卖标的物将由沪东拍卖任意处置。{/if}{/if}
                                </p>
                                <p class="book-content">对沪东拍卖相关规定及拍卖平台的相关全部条款，均已熟知。并自愿承担法律责任。</p>
                                <p class="book-content">本委托期限至此标的物处置结束止。</p>
                                <p class="book-stamp"> 委托单位（盖章）</p>
                                <p class="book-signature">委托人（签字）</p>
                            </div>
                            <p class="size-65 text-c" style="padding: 0.2rem 0px; border-top: 1px solid rgb(221, 221, 221); border-bottom: 1px solid rgb(221, 221, 221);">此委托书为格式文档,点击右上角分享打印盖章后上传</p>
                            <div class="bs-box-content-item border-b-none">
                                <p class="size-m">上传委托书</p>


                                <div class="uploader">
                                    <div class="uploader-content">
                                        <ul class="uploader-files" id="uploader-imges">
                                            {if !empty($info.entrust_url)}
                                            {foreach(info.entrust_url as $k =>$v)}
                                            <li class="uploader-file" style="background-image:url({$v})">
                                                <span class="close" onclick="deleteT(this)">x</span>
                                            </li>
                                            {/foreach}
                                            {/if}
                                        </ul>
                                        <div class="uploader-input-box">
                                            <input class="uploader-input" type="file" accept="image/*" onchange="handleInputChange1(event)"/>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="btn-box" style="margin-top: 1rem;">
                    <div class="flex">
                        <input type="hidden" id="i_id" value="{$info.i_id|default=''}">
                        <div class="pre-step my-btn" style="width: 47%;"><span style="background-color: rgb(255, 255, 255); color: rgb(0, 0, 0);" onclick="window.history.go(-1)">上一步</span></div>
                        <div class="pre-step my-btn" style="width: 47%;"><span class="active" id="submit">递交审核</span></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type='text/javascript' src='/static/wx/lib/sui/zepto.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='/static/wx/lib/sui/sm.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='/static/wx/lib/sui/sm-extend.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='/static/wx/js/upload.js' charset='utf-8'></script>
    <script>
        var n = $('.step-box').children().length;
        $('.step-item').css('width', document.body.clientWidth / n + 'px')
    </script>
    <script>
        // $('.uploader-input').on('touchend',function () {
        //
        //     // var file = $(this).val();
        //     // console.log(file);
        // });
        $('#submit').on('touchend',function(){
            var i_id = $('#i_id').val();

            var arr=[];
            $("#uploader-imges  li").each(function(index){
                var i=0;
                var url=$(this).css('background-image');
                url= url.split('("')[1].split('")')[0];
                arr.push(url);
            });
            $.ajax({
            url:'/wx/insurant/saveBolInfo',
            type:'post',
            dataType:'json',
            data:{
                'entrust_url':arr,
                'i_id':i_id,
                'now_status':5
            },
            success:function (data) {
                if(data.code ==200){
                    window.location.href = '/wx/index/index';
                }else{
                    $.alert(data.msg);
                }
            }
            });
        });


        function handleInputChange1(event) {
            var formData = handleInputChange(event);
            uploadImg(formData);

        }
        function  uploadImg(formData) {
            console.log(formData);
            $.ajax({
                type: 'POST',
                url: "{:url('upload/index')}",
                data: formData,
                processData: false,
                contentType: false,
                cache: false,
                success: function (Json) {
                    console.log(Json.data)
                    if (Json.code == 200) {
                        var url = decodeURI(Json.data.url)
                        a="<li class=\"uploader-file\" style=\"background-image:url('"+url+"')\">";
                        a+= "<span class=\"close\" onclick='deleteT(this) '>x</span>"
                        a+= "</li>"
                        $('#uploader-imges').append(a);
                    } else {
                        $.alert('上传失败');
                    }
                }
            });
        }

        function deleteT(obj) {
            $(obj).parent('li').remove();
        }
    </script>



</body>

</html>